package cn.hl.hm.constants;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
 *  自定义返回码
 *  
 * 2016-12-29
 * 
 * @author 大和
 */
public class InfoCode {

	private int status;

	private String msg;

	private static final String DEFAULT_INFOCODE_MSG = "系统错误";

	public InfoCode(int status) {
		this.status = status;
		this.msg = DEFAULT_INFOCODE_MSG;
	}

	public InfoCode(int status, String msg) {
		this.status = status;
		this.msg = msg;
	}

	public static final InfoCode SUCCESS = new InfoCode(0, "成功");

	public static final InfoCode FAILURE = new InfoCode(1, "失败");


	public static final InfoCode PARAM_ERROR = new InfoCode(4004, "请求参数错误");


	public int getStatus() {
		return status;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}


}
